home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 2325 / 2325.xpi / chrome / content / one-riot-suggestion.xul < prev    next >
Extensible Markup Language  |  2009-11-24  |  3KB  |  62 lines

  1. <?xml version="1.0"?>
  2. <?xml-stylesheet type="text/css" href="chrome://global/skin/global.css"?>
  3. <!DOCTYPE dialog SYSTEM "chrome://rss-ticker/locale/locale.dtd">
  4. <dialog title="&trendsTitle;"
  5.     id="rssticker-oneriot-dialog"
  6.     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  7.     buttons="accept,cancel"
  8.     buttondisabledaccept="true"
  9.     ondialogaccept="return subscribeToFeed();"
  10.     ondialogcancel="return cancelSearchProvider();"> 
  11.     
  12.     <script type="application/x-javascript">
  13.         <![CDATA[
  14.             var feedUrl = "http://www.oneriot.com/rss/trendingtopics?&spid=86f2f5da-3b24-4a87-bbb3-1ad47525359d&p=rss-ticker&ssrc=ticker";
  15.             
  16.             var subscribeToFeed = function() {
  17.                 if (document.getElementById("understand").checked) {
  18.                     var strings = document.getElementById("RSSTICKER-bundle");
  19.                 
  20.                     var livemarkService = Components.classes["@mozilla.org/browser/livemark-service;2"];
  21.                     var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
  22.                     var bmsvc = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Components.interfaces.nsINavBookmarksService);
  23.                     var annotationService = Components.classes["@mozilla.org/browser/annotation-service;1"].getService(Components.interfaces.nsIAnnotationService);
  24.                     var livemarkService = Components.classes["@mozilla.org/browser/livemark-service;2"].getService(Components.interfaces.nsILivemarkService);
  25.                     var menu = Application.bookmarks.menu;
  26.                     var uri = ioService.newURI(feedUrl, null, null);
  27.                     var feedUri = ioService.newURI(feedUrl, null, null);
  28.                     var lm = livemarkService.createLivemarkFolderOnly(Application.bookmarks.menu.id, strings.getString("trendBookmarkTitle"), uri, feedUri, -1);
  29.                     annotationService.setItemAnnotation(lm, "bookmarkProperties/description", strings.getString("trendBookmarkDescription"), 0, Components.interfaces.nsIAnnotationService.EXPIRE_NEVER);
  30.                 }
  31.                 
  32.                 return true;
  33.             }
  34.  
  35.             var cancelSearchProvider = function () {
  36.                 if (document.getElementById("understand").checked) {
  37.                     document.getElementById("understand").checked = false;
  38.                     document.getElementById('rssticker-oneriot-dialog').setAttribute('buttondisabledaccept', true);
  39.                     return false;
  40.                 }
  41.  
  42.                 return true;
  43.             }
  44.         ]]>
  45.     </script>
  46.     <stringbundleset>
  47.         <stringbundle id="RSSTICKER-bundle" src="chrome://rss-ticker/locale/locale.properties" />
  48.     </stringbundleset>
  49.     <hbox>
  50.         <vbox>
  51.             <image src="chrome://rss-ticker/content/skin-common/search-trio.png" style="padding: 20px;"/>
  52.         </vbox>
  53.         <vbox style="width: 350px; padding-left: 20px;" align="center" pack="center">
  54.             <description>&trendsP1;</description>
  55.             <description>&trendsP2;</description>
  56.             <description>&trendsP3;</description>
  57.             <hbox align="center">
  58.                 <checkbox id="understand" label="&checkbox_understand;" oncommand="document.getElementById('rssticker-oneriot-dialog').setAttribute('buttondisabledaccept', !this.checked);" />
  59.             </hbox>
  60.         </vbox>
  61.     </hbox>
  62. </dialog>